#{extends 'main.html' /}
#{set title:'订单列表' /}
  <body>
    <div class="page-group">
      <div class="page">

        <section class="complaint_list content scroll_y">

            <header class="bar bar-nav">
                <a href="javascript:history.go(-1);" class="icon icon-left pull-left"></a>
                <h1 class='title'>绑定手机号</h1>
            </header>
            <div class="bar bar-header-secondary">
                <div class="searchbar">
                    <a class="searchbar-cancel" onclick="showUser()" > 搜索</a>
                    <div class="search-input"  >
                        <label class="icon icon-search" for="search"></label>
                        <input type="search" id='searchPhone'   placeholder='输入关键字...'/>
                    </div>
                </div>
            </div>
            <div id="userList" class="tabs" style=" margin-top:2rem;">
            </div>
        </section>
      #{include '/BillCtrl/bindingUserrList.html'/}

      #{include 'footer.html'/}
      </div>
    </div>
    <script>$.init();</script>
    <script>
            function  showUser() {
                var searchPhone = $('#searchPhone').val();
                    $.getJSON('/bill/bindingUserByPhone',{ searchPhone:searchPhone},function (data) {
                        console.log(data);
                        console.log("data.success",data.success);
                        if(data.success){
                            var dataList = data.webUserList;
                            var gettpl = document.getElementById('user_list_tpl').innerHTML;
                            laytpl(gettpl).render(dataList, function (html) {
                                document.getElementById('userList').innerHTML = html;
                                $("#userList").scrollTop(0);

                            });
                        }else {
                            $.toast('此手机号不存在!')
                        }
                    })
            }
    </script>
  </body>
